package com.lagou.homework.controller;

import com.lagou.homework.service.EmailService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class EmailController {
    @Reference
    private EmailService emailService;
    /*
        发送邮件的微服务
     */
    @GetMapping("/email/{email}/{code}")
    public boolean sendEmail(@PathVariable("email") String email,@PathVariable("code") String code){
        return emailService.sendEmail(email, code);
    }
}
